package com.ssm.dao;

import com.ssm.domain.SysFile;
import com.ssm.domain.SysLog;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 日志数据操作接口
 */
public interface ISysLogDao {

    @Insert("insert into syslog(visitTime,username,ip,url,executionTime,method) values(#{visitTime},#{username},#{ip},#{url},#{executionTime},#{method})")
    public void save(SysLog sysLog) throws  Exception;

    @Select("select * from sysLog order by visitTime desc")
    List<SysLog> findAll() throws Exception;

    @Select("select * from sysLog order by visitTime")
    List<SysLog> findAllsortByDate();

    @Delete("delete from sysLog")
    void deleteAll();
    @Delete("delete from sysLog where id=#{syslogId}")
    void deleteById(String syslogId);
}
